The marmap package provides world wide high resolution bathymetry data.
source("ggPlotBathymetry.R")
baltic.bathy <- get.bathymetry(lon1 = 4, lon2 = 30,
lat1 = 53, lat2 = 67,
bathy.breaks = c(seq(0, 50, length.out = 6),
seq(100, 300, length.out = 3),
+Inf))
## File already exists ; loading 'marmap_coord_4;53;30;67_res_1.csv'
ggplot(baltic.bathy) +
geom_tile(aes(x=Longitude, y=Latitude, fill=Depthsteps_m)) +
scale_fill_brewer(palette = "Blues", name = "Water depth [m]")
The mapdata package allows to download world coastline polygon data. Unfortunately these are missing some ‘small’ islands (like Hiddensee). Haven’t found a workaround for that yet…
baltic.coastlines <- map_data('worldHires', xlim = c(4, 29), ylim = c(50, 66))
ggplot(baltic.coastlines) +
geom_polygon(aes(x=long, y=lat, group=group), colour = "red", fill = NA)
… combine plot of bathymetry and coastlines in one function plot.bathymetry()
plot.bathymetry()
## File already exists ; loading 'marmap_coord_4;53;30;67_res_1.csv'
… with the bathymetry depth range of the whole Baltic Sea …
plot.bathymetry(lon.min = 4, lon.max = 30,
lat.min = 53, lat.max = 67) +
coord_quickmap(xlim = c(10, 20), ylim = c(54, 58))
## File already exists ; loading 'marmap_coord_4;53;30;67_res_1.csv'
… or adapted to plot region.
plot.bathymetry(lon.min = 10, lon.max = 15, lat.min = 54, lat.max = 56)
## File already exists ; loading 'marmap_coord_10;54;15;56_res_1.csv'
long <- 110
lat <- 5
plot.bathymetry(lon.min = long, lon.max = long +40, lat.min = lat, lat.max = lat + 15,
bathy.breaks = c(0, 1000, 2000, 3000, 4000, 5000, 6000, 7000, +Inf),
land.colour = "grey20", border.colour = "pink")
## File already exists ; loading 'marmap_coord_110;5;150;20_res_1.csv'
Viola! Have fun …